package com.acme.task5;

public class TextModifier {
	public static void main(String[] args) {
		if (args.length == 0) {
			System.out.println("Please, provide a string as an argument.");
			return;
		}

		String input = args[0];
		System.out.println(input);
		System.out.println(modifyText(input));
	}
	
	private static String modifyText(String str) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < str.length(); i++) {
			char charAtIndex = str.charAt(i);

			if ((charAtIndex == '+') || (charAtIndex == '-')) {
				sb.append(charAtIndex);
				sb.append(charAtIndex);
			} else if (!Character.isDigit(charAtIndex)) {
				sb.append(charAtIndex);
			}
		}
		return sb.toString();
	}
}
